package com.xuxin.nantai.presenter;

import com.xuxin.nantai.bean.BaseBean;
import com.xuxin.nantai.bean.CompleteDetailBean;
import com.xuxin.nantai.contract.CompleteDetailContract;
import com.xuxin.nantai.model.CompleteDetailModel;

/**
 * Created by xu_xin
 * Created on 2020.06.08 0008
 */
public class CompleteDetailPresenter implements CompleteDetailContract.Presenter {
    private CompleteDetailModel model;
    private CompleteDetailContract.View view;

    public CompleteDetailPresenter(CompleteDetailContract.View view) {
        model = new CompleteDetailModel();
        this.view = view;
    }

    @Override
    public void getCompleteDetail(String id) {
        if (null != model) {
            model.getCompleteDetail(this, id);
        }
    }

    @Override
    public void delete(String loginName,String UserName, String Guid) {
        if (null != model) {
            model.delete(this,loginName, UserName,Guid);
        }
    }

    @Override
    public void onSuccess(CompleteDetailBean completeDetailBean) {
        if (null != view) {
            view.onSuccess(completeDetailBean);
        }
    }

    @Override
    public void onSuccess(BaseBean baseBean) {
        if (null != view) {
            view.onSuccess(baseBean);
        }
    }

    /**
     * 以下内容复用
     */
    @Override
    public void onError(BaseBean baseBean) {
        if (null != view) {
            view.onError(baseBean);
        }
    }

    @Override
    public void onComplete() {
        if (null != view) {
            view.onComplete();
        }
    }
}